import request from '@/utils/request';

export async function getEnergyInfoByPage(params: any) {
  return request('/api/device/getEnergyInfoByPage', {
    method: 'POST',
    data: params,
  });
}

export async function addEnergyInfo(params: any) {
  return request('/api/device/addEnergyInfo', {
    method: 'POST',
    data: params,
  });
}

export async function updateEnergyInfo(params: any) {
  return request('/api/device/updateEnergyInfo', {
    method: 'POST',
    data: params,
  });
}
export async function uploadEnergyInfo(params: any) {
  return request('/api/device/updateEnergyInfo', {
    method: 'POST',
    data: params,
  });
}

export async function delEnergyInfo(params: any) {
  return request('/api/device/delEnergyInfo', {
    method: 'POST',
    data: params,
  });
}

export async function exportEnergyInfo(params: any) {
  return request('/api/device/exportEnergyInfo', {
    method: 'POST',
    data: params,
    responseType: 'blob',
  });
}

export async function getDictDataByPageAndDictType(params: any) {
  return request('/api/service/getDictDataByPageAndDictType', {
    method: 'POST',
    data: params,
  });
}

export async function uploadEhsFile(params: any) {
  return request('/api/device/uploadEhsFile', {
    method: 'POST',
    data: params,
  });
}

export async function getDeIds(params: any) {
  return request('/api/device/getDeIds', {
    method: 'POST',
    data: params,
  });
}

export default {
  getEnergyInfoByPage,
  addEnergyInfo,
  updateEnergyInfo,
  delEnergyInfo,
  uploadEhsFile,
  getDictDataByPageAndDictType,
  exportEnergyInfo,
  uploadEnergyInfo,
};
